Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial bringup for Linux/Thumb2 #8683

Merged
merged 3 commits into from
May 6, 2021
Merged

Conversation

LemonBoy
Copy link
Contributor

@LemonBoy LemonBoy commented May 4, 2021

@andrewrk I'd love your input on the XXX comment in system.zig

LemonBoy added 3 commits May 4, 2021 18:43
Pointer types need an extra indirection layer during the generation of
the function prototype for inline asm blocks.

Closes ziglang#3606
To be honest all this detection logic is starting to become a real PITA,
the ARM32 version can be possibly removed as the generic version
optimizes pretty well...
There are some small problems here and there, mostly due to the pointers
having the lsb set and disrupting the fn alignment tests and the
`@FrameSize` implementation.
Comment on lines +353 to +354
// XXX What do we do if the target has the noarm feature?
// What do we do if the user specifies +thumb_mode?
Copy link
Member

@andrewrk andrewrk May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fundamental problem here is that we have multiple different ways of representing the same state.

Let's try to eliminate redundancies. Here are some (breaking) ideas:

  • Remove the thumb sub-architecture in favor of the thumb_mode CPU feature. Instead of -target thumb-linux it would be -target arm-linux -mcpu=generic+v7m
  • Delete the noarm CPU feature since it appears to be completely redundant with thumb_mode. All feature sets that include thumb_mode also include noarm.
    • we would probably still need to emit noarm when lowering thumb_mode cpu features to LLVM

After a few minutes considering this I think I would be in favor of both these ideas.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The former makes more sense, noarm is effectively a CPU feature that signals no interworking is possible at all.
Clang takes a similar approach and requires -mthumb or -mno-thumb to be specified, that's another possible solution to take into account.

@andrewrk andrewrk merged commit 530e67c into ziglang:master May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants